#include <linux/mm.h>
#include <linux/swap.h>
/**
 * __lru_cache_del: remove a page from the page lists
 * @page: the page to add
 *
 * This function is for when the caller already holds
 * the pagemap_lru_lock.
 */
void __lru_cache_del(struct page * page)
{
    if (TestClearPageLRU(page)) {
        if (PageActive(page)) {
            del_page_from_active_list(page);
        } else {
            del_page_from_inactive_list(page);
        }
    }
}

/**
 * lru_cache_del: remove a page from the page lists
 * @page: the page to remove
 */
void lru_cache_del(struct page * page)
{
    spin_lock(&pagemap_lru_lock);
    __lru_cache_del(page);
    spin_unlock(&pagemap_lru_lock);
}